#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
int main (int argc, char const *argv[])
{
    printf("%d\n", fac(4));
    return 0;
}

int fac(int n)
{
    if (n < 2) return(1);
    return (n)*fac(n-1);
}


#include </Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h>

static PyObject *cModule_fac(PyObject *self, PyObject *args)
{
    int num;
    if(!PyArg_ParseTuple(args, "i", &num))
    {
        return NULL;
    }
    return (PyObject*)Py_BuildValue("i", fac(num));
}

static PyMethodDef cModuleMethods[] = {
    {"fac", cModule_fac, METH_VARARGS},
    {NULL, NULL},
};

void initcModule()
{
    Py_InitModule("cModule", cModuleMethods);
}